package com.lsg.demo3.controller;


import com.lsg.demo3.entity.Message;
import com.lsg.demo3.service.IMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.lsg.demo3.controller.BaseController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 消息（友范） 前端控制器
 * </p>
 *
 * @author leishuiguang
 * @since 2019-07-14
 */
@RestController
@RequestMapping("/message/message")
public class MessageController extends BaseController {

    @Autowired
    private IMessageService iMessageService;

    @GetMapping("/list")
    public Map<String, Object> testList(){
        List<Message> list = iMessageService.list();
        Map<String, Object> map = new HashMap<>();
        map.put("data", list);
        return map;
    }

}
